import request from "../util/request";


    


export const loginApi = (body)=>{
    return request("/login",{
        method:"post",
        // headers:{
        //    'Content-Type':'application/x-www-form-urlencoded'
        //     },
        // data,
        body
    })
}

//根据用户名获取权限菜单
   
export const menuApi = (username)=>{
    return request(`/menu/${username}`,{
        method:"get",
        headers:{
            Authentication:localStorage.token
            },
        query:username
    })
}



// 获取用户数据
export const userApi = (query) => request('/user', {
    
    query: {
            pageSize: 100,
            pageNum:1,
        ...query,
    }
})

// // 获取角色数据
// export const getRoleDataApi = (query) => request("/role", {
//     query: {
//         pageSize: 100,
//         // pageNum:1,
//         ...query,
//     }
// })

//新增用户
export const createUserApi = (body) => request('/user', {
    
    method:'post',
    body
})

//删除用户
export const deluserApi = (query) => request(`/user/${query}`, {
    method:"delete",
})

//修改角色

export const changeuserApi = (body) => request(`/user`, {
    method:"put",
    body
})

//主页浏览数据
export const getEchartsApi = (query) => request(`/index/${query}`,{
    
})

